<style lang="scss" scoped>
</style>
<template>
  <div>
    <el-popover
      placement="top-start"
      trigger="hover">
      <VueQrcode :value="connectCode" :options="{ size: 200 }" id="vueQrcodeLoad"></VueQrcode>
      <i class="el-icon-mobile-phone" slot="reference" style="font-size: 30px;"></i>
    </el-popover>
  </div>
</template>

<script>
export default {
  data () {
    return {
      connectCode: ''
    }
  },
  mounted () {
    this.$http.loadInDiv('vueQrcodeLoad').get('/scan/getShopConnectCode/' + this.shopId).then(data => {
      this.connectCode = this.Constants.serverHost + '/scanClient/scan.html?connectCode=' + data.result + '&shopId=' + this.shopId
    })
  },
  props: {
    shopId: {
      type: String,
      validator: function (value) {
        // 这个值必须匹配下列字符串中的一个
        return value !== ''
      }
    }
  }
}
</script>
